export const ComponentsMixins = {
  components: {
    HeaderTitle: () => import('../components/common/HeaderTitle'),
    HeaderTab: () => import('../components/common/HeaderTab'),
    SmallTitle: () => import('../components/common/SmallTitle'),
    BaseMap: () => import('../components/common/BaseMap'),
    DoughnutChart: () => import('../components/common/DoughnutChart'),
    BarChart: () => import('../components/common/BarChart'),
    AccumulationBarChart: () => import('../components/common/AccumulationBarChart'),
    LineChart: () => import('../components/common/LineChart'),
    LineBarChart: () => import('../components/common/LineBarChart'),
    LineAreaChart: () => import('../components/common/LineAreaChart'),
    CycleTab: () => import('../components/common/CycleTab'),
    StationInfo: () => import('../components/zxc/StationInfo'),
    BaseInfo: () => import('../components/gj/BaseInfo'),
    GcBaseInfo: () => import('../components/gj/GcBaseInfo'),
    FlBaseInfo: () => import('../components/gj/FlBaseInfo'),
    TmcBaseInfo: () => import('../components/gj/TmcBaseInfo'),
    ViolationTop5: () => import('../components/orderly/ViolationTop5'),
    BusInfo: () => import('../components/orderly/BusInfo'),
    YiLaoInfo: () => import('../components/aq/YiLaoInfo'),
    AqVideoInfo: () => import('../components/aq/AqVideoInfo'),
    ParkInfo: () => import('../components/tcc/ParkInfo'),
    LdKzxInfo: () => import('../components/ld/LdKzxInfo'),
    GdfdcTable: () => import('../components/hw/GdfdcTable'),
    YjswclzxTable: () => import('../components/hw/YjswclzxTable'),
    XltmcTable: () => import('../components/hw/XltmcTable'),
    GdccljclTable: () => import('../components/hw/GdccljclTable')
  },
  methods: {
    getCurrentDate(type = 'day') {
      let startTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
      let endTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')

      switch (type) {
        case 'day':
          break
        case 'yesterday':
          endTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
          startTime = this.$moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm:ss')
          break
        case 'currentDay':
          endTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
          startTime = this.$moment().format('YYYY-MM-DD 00:00:00')
          break
        case 'week':
          endTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
          startTime = this.$moment().subtract(6, 'days').format('YYYY-MM-DD HH:mm:ss')
          break
        case 'last7':
          endTime = this.$moment().format('YYYY-MM-DD HH:mm:ss')
          startTime = this.$moment().subtract(6, 'days').format('YYYY-MM-DD 00:00:00')
          break
        case 'month':
          startTime = this.$moment().startOf('month').format('YYYY-MM-DD HH:mm:ss')
          endTime = this.$moment().endOf('month').format('YYYY-MM-DD HH:mm:ss')
          break
        default:
          break
      }
      return {startTime, endTime}
    }
  }
}
